from django.contrib import admin
from .models import ReviewRecord

# Register your models here.

@admin.register(ReviewRecord)
class ReviewRecordAdmin(admin.ModelAdmin):
    list_display = ['id', 'review_type', 'student', 'reviewer', 'status', 'review_time', 'created_at']
    list_filter = ['review_type', 'status', 'created_at', 'review_time']
    search_fields = ['student__username', 'reviewer__username', 'content', 'remarks']
    list_per_page = 20
    ordering = ['-created_at']
    readonly_fields = ['created_at', 'updated_at']
    
    fieldsets = [
        ('审查信息', {
            'fields': ['review_type', 'student', 'status']
        }),
        ('审核详情', {
            'fields': ['reviewer', 'review_time', 'content', 'remarks']
        }),
        ('元数据', {
            'fields': ['created_at', 'updated_at'],
            'classes': ['collapse']
        }),
    ]
